<template>
  <div class="lhj">
    <Lhj ref="lhj" :allData="allData" :result="result" />
    <button @click="start">开始</button>
  </div>
</template>

<script>
import Lhj from "@/components/lhj.vue";
export default {
  components: {
    Lhj,
  },
  data() {
    return {
      allData: [],
      results: [
        ["图片1", "图片3", "图片5"],
        ["图片2", "图片4", "图片6"],
      ],
      result: [],
    };
  },
  mounted() {
    for (let i = 0; i < 3; i++) {
      this.allData.push([]);
      for (let k = 1; k < 10; k++) {
        this.allData[i].push({
          index: k,
          name: "图片" + k,
        });
      }
    }
  },
  methods: {
    start() {
      this.changeResult();
      this.$refs.lhj.start();
    },
    changeResult() {
      if (this.results.length > 0) {
        this.result = this.results[0];
        this.results.shift();
      }
    },
  },
};
</script>

<style lang="less" scoped>
</style>
